package practice.w917;

public class StringDemo {
    public static void main(String[] args) {
        String s1 = "123abc";
        String s2 = "123abc";
        System.out.println(s1==s2);
        String s3 = "123abc";
        System.out.println(s1==s3);
        String s4 = new String("123abc");
        System.out.println(s4==s1);
        s1 = s1 + "!";
        System.out.println(s1==s2);
        System.out.println(s1.equals(s2));

//        String s1 = "123abc";
//        String s2 = "123abc";
//        System.out.println(s1==s2);
//        String s3 = "123abc";
//        System.out.println(s1==s3);
//        String s4 = new String("123abc");
//        System.out.println(s4==s1);
//        s1 = s1 + "!";
//        System.out.println(s1==s2);
//        System.out.println(s1.equals(s2));
    }
}



















